﻿@model IList<FB.Providers.EmployeeInfo.Position>
@helper NodeHelper(FB.Providers.EmployeeInfo.Position post, IList<FB.Providers.EmployeeInfo.Position> postList, string seedpading)
{ 
    IList<FB.Providers.EmployeeInfo.Position> list = postList.Where(t => t.ParentPOSCode == post.POSCode).ToList();
   
    if (list.Count != 0)
    {

        foreach (FB.Providers.EmployeeInfo.Position postItem in list)
       {
           <option  value="@postItem.POSCode"  PositionName="@postItem.Name">@(seedpading+postItem.Name)</option>  
            @NodeHelper(postItem, Model,seedpading+"--")   
       } 
    } 
}
<select id="PositionList" name="PositionList"  style="width:120px; margin-left: 5px;"  class="PositionList">  
@{
    IList<FB.Providers.EmployeeInfo.Position> rootNodeList = Model.Where(t => t.ParentPOSCode == null || t.ParentPOSCode == "").ToList();
    if (rootNodeList != null && rootNodeList.Count>0)
    {
        foreach (var item in rootNodeList)
        {
           
            <option value="@item.POSCode"   PositionName="@item.Name">@item.Name</option>
            @NodeHelper(item, Model,"--")   
        }
    } 
}
</select>